import { useState } from "react";

function FormSon() {
  const [text, setText] = useState("");

  return <textarea value={text} onChange={e => setText(e.target.value)} />;
}

function Form() {
  const [showHint, setShowHit] = useState(false);

  return (
    <div>
      {showHint && (
        <p>
          <i>提示：你最喜欢的城市？</i>
        </p>
      )}
      <FormSon />
      <br />
      <button onClick={() => setShowHit(showHint ? false : true)}>{showHint ? "隐藏提示" : "显示提示"}</button>
    </div>
  );
}

export default Form;
